﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SmallCart.aspx.cs" EnableViewState="false" Inherits="eCommerce.web.Ajax.Common.Cart" %>
<%@ Import Namespace="eCommerce.core.Helpers" %>
<script type="text/javascript" src="/js/jquery-1.8.2.min.js"></script>
<script type='text/javascript' src='/js/jquery.easing.1.3.js'></script> <!--camera slider-->

<form id="formCart" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            $("#cart-link").click(function () {
                $("#cart-panel").slideToggle(200);
            });
        });

        $(document).keydown(function (e) {
            if (e.keyCode == 27) {
                $("#cart-panel").hide(0);
            }
        });
    </script>

    <div id="demo-header">
        <a id="cart-link" href="#cart" title="Cart"><asp:Literal ID="ltCart" runat="server" /></a>
        <div id="cart-panel" style="display: <%= IsShow %>">
            <div class="item-cart">            
                <table>
                    <tbody>
                    <asp:Repeater ID="rptCart" OnItemDataBound="rptCart_ItemDataBound" runat="server">
                    <ItemTemplate>
                        <asp:HiddenField ID="hfProduct" Value='<%# Eval("ProductId") %>' runat="server"/>                
                        <asp:HiddenField ID="hfQuantity" Value='<%# Eval("Quantity") %>' runat="server"/>                
                        <tr>
                            <td class="image"><asp:Literal ID="ltImage" runat="server" /></td>
                            <td class="name"><asp:Literal ID="ltName" runat="server" /></td>
                            <td class="quantity">x&nbsp;<%# Eval("Quantity")%></td>                        
                            <td class="total"><asp:Literal ID="ltTotalItem" runat="server" /></td>
                            <td class="remove"><i onclick="removeItem(<%# Eval("ProductId") %>);" class="icon-remove"></i></td>                        
                        </tr>
                    </ItemTemplate>
                    </asp:Repeater>                
                    </tbody>
                </table>
                <table>
                    <tbody>
                    <tr>
                        <td class="textright"><b>Tổng tiền:</b></td>
                        <td class="textright"><asp:Literal ID="ltTotalCart" runat="server" /></td>
                    </tr>                
                    </tbody>
                </table>
                <div class="buttoncart">
                    <a href="<%= UrlHelper.Cart %>">Giỏ hàng</a>
                </div>
            </div>
        </div>
    </div>    
</form>